import { Request, Response } from 'express'
import Mock from 'mockjs'

// const uuid = () => {
//   return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
//     // eslint-disable-next-line no-bitwise
//     const r = (Math.random() * 16) | 0
//     // eslint-disable-next-line no-bitwise
//     const v = c === 'x' ? r : (r & 0x3) | 0x8
//     return v.toString(16)
//   })
// }

const storeRole = Mock.mock({
  "message": "收银，角色管理",
  "status": "success",
  'data|3-10': [
    {
      'key': '@guid()',
      'id|+1': 1,
      'roleName': '@cname',
      'roleDescription|2-3': '@csentence(3, 5)',
      'accountStatus': '@boolean',
      'qeCodeBind': '@url',
      'option': '@color'
    }
  ]
})





export default {
  'GET /api/getStoreRole': async (req: Request, res: Response) => {
    console.log(req.query)
    res.json(storeRole)
  }
};